# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: detiam <dehe_tian at outlook dot com>

_pyname=pygdbmi
pkgname=python-$_pyname
pkgver=0.11.0.0
pkgrel=3
pkgdesc='Parse gdb machine interface output with Python'
url='https://github.com/cs01/pygdbmi'
license=(MIT)
arch=(any)
depends=(gdb
         python)
makedepends=(python-build
             python-installer
             python-setuptools
             python-wheel)
checkdepends=(python-pytest)
source=(https://github.com/cs01/pygdbmi/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('5c52a37211d55eeeaf5c06eacc8e8d49e9dacfd36a526d3534b4a5d5f5ee94d9')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pyname-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest -v
}
  
package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
